home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
gnu
/
dejagnu.lha
/
dejagnu-1.0.1
/
expect
/
fixline1
< prev
next >
Wrap
Text File
|
1993-03-02
|
530b
|
26 lines
#!expect -f
# Synopsis: expect fixline1 newpath < input > output
# Author: Don Libes
# Description: change first line of script to reflect new binary
set newpath [lindex $argv 1]
gets stdin buf
# try to match any of the following match
#!expect ...
#!../expect ...
#!expectk ...
#!foobar/expectk ...
if 1==[regexp "^#!(.*/)*(.*)" $buf dummy1 dummy2 tail] {
puts stdout "#!$newpath/$tail"
# puts stdout "#!$new/ [lrange [split $buf " "] 1 end]"
} else {
puts stdout $buf
}
while {-1!=[gets stdin buf]} {
puts stdout $buf
}